package com.base;

public class Testpriority {
    public  static  void main(String [] args){
        Runnable runnable=new Runnable() {
            public void run() {
                while(true)
                {
                    System.out.println("线程——"+ Thread.currentThread().getName());
                }
            }
        };

        Thread thread1= new Thread(runnable);
        Thread thread2= new Thread(runnable);
        //priority1——10，默认为5
        thread1.setPriority(10);
        thread2.setPriority(1);
        thread1.start();
        thread2.start();

    }
}
